<?php

header("content-type: text/html; charset=iso-8859-1;", true);

$dbHost = "127.0.0.1:3306";
$dbUser = "root";
$dbPass = "babilonia";
$dbData = "protocolo";

$conn = mysql_connect($dbHost,$dbUser,$dbPass) or die(mysql_error());
mysql_select_db($dbData,$conn) or die(mysql_error());

mysql_query("SET NAMES 'utf8';");

session_start();

$numero=$_POST["Numero"];
$origem=$_POST["Origem"];

$data=$_POST["Data"];
$destino=$_POST["Destino"];
$endereco=$_POST["End_Destino"];
$descricao=$_POST["Descricao_Anexo"];

$query="UPDATE tab_protocolo SET Data='$data', Destino='$destino', End_Destino='$endereco', Descricao_Anexo='$descricao' WHERE Numero='$numero' AND Origem='$origem'";

if(!mysql_query($query, $conn)) {
	echo "{success: false}";
}

else {
    echo "{success: true}";
}

?>